use tauri::Listener;
use tauri::Manager;
#[allow(dead_code)]
pub fn app_listen(app: &mut tauri::App) {
    println!("setup.rs: app_listen");

    app.listen("component-loaded", move |event| {
        println!("window just loaded a component{:?}", event.payload());
    });
    app.once("ready", |event| {
        println!("app is ready, {:?}", event.payload());
    });
}
#[allow(dead_code)]
pub fn webview_listen(app: &mut tauri::App) {
    let webview = app.get_webview_window("main").unwrap();
    webview.listen("logged-in", |event| {
        let session_token = event.payload();
        println!("logged-in: {:?}", session_token);
        // save token..
    });
}
